package com.hospital.service.project.model.param;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hospital.service.project.entity.ProGroupInfo;
import com.hospital.service.project.entity.help.ProGroupInfoHelp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import enhance.plus.util.MybatisPlusUtil;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * 实验分组表 新增参数
 *
 * @author lfb
 * @created 2020-10-19 09:02:05
 */
@Data
@ToString
@Accessors(chain = true)
@ApiModel(value="ProGroupInfo[实验分组表]入参")
public class ProGroupInfoQueryForOneRowParam implements Serializable{

    /**
    * ID
    */
    @ApiModelProperty(value = "ID", required = false , example = "")
    private String id;

    /**
     * 分组检索编号
     */
    @ApiModelProperty(value = "分组检索编号", required = false , example = "")
    private String groupNumber;

    /**
     * 分组名称
     */
    @ApiModelProperty(value = "分组名称", required = false , example = "")
    private String groupName;

    /**
     * 概述
     */
    @ApiModelProperty(value = "概述", required = false , example = "")
    private String summary;

    /**
     * 样本数
     */
    @ApiModelProperty(value = "样本数", required = false , example = "")
    private String samplesTotalNumber;

    /**
     * 所属项目检索编号**[外键]**
     */
    @ApiModelProperty(value = "所属项目检索编号**[外键]**", required = false , example = "")
    private String projectNumber;

    /**
     * 把非 null 的值 转换成一个 查询条件
     * @return
     */
    public QueryWrapper<ProGroupInfo> convertParamToQueryWapper(){
        QueryWrapper<ProGroupInfo> query = ProGroupInfoHelp.createQuery();
        Map<String, Object> result =  MybatisPlusUtil.convertParamToMap(this, ProGroupInfo.class);
        query.allEq(result);
        return query;
    }
}
